package gui;

import ead.Stack;

public class MenuManager {

	private Stack<Box> boxStack;

	/**
	 * @param boxStack
	 */
	public MenuManager() {
		this.boxStack = new Stack<Box>();
	}
	
	public Box top(){
		return boxStack.top();
	}
	
	public int size(){
		return boxStack.size();
	}
	
	public void addMenu(Box box){
		if(!boxStack.isEmpty()){
			Box top = boxStack.top();
			top.setVisible(false);
			top.setActive(false);
		}
		boxStack.push(box);
	}
	
	public void removeMenu(){
		Box removed = boxStack.pop();
		removed.destroySelf();
		Box top = boxStack.top();
		top.setVisible(true);
		top.setActive(true);
	}
}
